Build phantomjs2 (this should detect the number of cores and parallelize the build, if not you can add --jobs 4, for example)
./build.sh --confirm
If this fails, you might need to up your memory and make sure you are not doing anything else.
If you get an error related to a problem with a .o or some object missing from a library, up your memory as well. And then do this to restart the whole build
I had a lot of failures and it is probably related to running out of memory. If you are doing nothing else, 4 gb is probably enough. I was using IntelliJ and running a command line build and once I hit 53 free megabytes out of 7 gb and realized that was probably why it was failing.
This creates bin/phantomjs. You can move the executable anywhere, it does depend on shared libraries on your system.
Full-disclosure, building this on my VM has caused it to hang. I kill it and restart the build. But if you are using VirtualBox, it might be unstable.
The steps are repeated here because the order is different from the base instructions:
I had a lot of failures and it is probably related to running out of memory. If you are doing nothing else, 4 gb is probably enough. I was using IntelliJ and running a command line build and once I hit 53 free megabytes out of 7 gb and realized that was probably why it was failing.